package no.ntnu.fp.model;

import java.awt.BorderLayout;
import java.awt.Container;

import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;

import no.ntnu.fp.watch.gui.platformPanel;

public class MainTest
{
	public static void main(String[] args)
	{


		Object[] options = {"Watch",
        "Master Watch"};

		int n = JOptionPane.showOptionDialog(null,
			    "Watch or Master WATCH?",
			    "Choose mode",
			    JOptionPane.YES_NO_OPTION,
			    JOptionPane.QUESTION_MESSAGE,
			    null,     //do not use a custom Icon
			    options,  //the titles of buttons
			    options[0]); //default button title
		
		if(n == 1){
			Watch.isMaster = true;
			initWatch(true);
		}
		else if (n == 0){
			Watch.isMaster = false;
			initWatch(false);
		}

		
		

	
	}
	
	public static void initWatch(boolean master)
	{
		Platform platform = new Platform("Statfjord A");
		
		Watch watch = new Watch(platform, master);
		
		watch.setLayout(new BorderLayout());
		watch.add(watch.getPlatformPanel(), BorderLayout.CENTER);
	
        watch.pack();
        watch.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        watch.setExtendedState(watch.getExtendedState()|JFrame.MAXIMIZED_BOTH);
        watch.setPreferredSize(Watch.screenSize);
        watch.setSize(Watch.screenSize);
        watch.setResizable(false);
        
        watch.setVisible(true);
	}
}